import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;

public class three {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        System.out.print("输入一个整数:");
        int number = in.nextInt();
        String str="";
        StringBuilder st = new StringBuilder();
        for (int i = 1; i <= number * 2 - 1; i++) {
            if (i <= number) {
                for (int j = number; j > i; j--) {
                    System.out.print(" ");
                    st.append(" ");
                }
                for (int x = 1; x <= i * 2 - 1; x++) {
                    System.out.print("*");
                    st.append("*");

                }
            } else {
                for (int j = 1; j <= i - number; j++) {
                    System.out.print(" ");
                    st.append(" ");
                }
                for (int x = number * 2 - 2; x > (i - number) * 2 - 1; x--) {
                    System.out.print("*");
                    st.append("*");
                } }
            System.out.println();
            st.append("\n");
        }
        str=st.toString();
        File file = new File("d:", "Shape.txt");
        file.createNewFile();
        byte bt[] = new byte[1024];
        bt = str.getBytes();
        FileOutputStream out = new FileOutputStream(file);
        out.write(bt, 0, bt.length);
        out.close();
    }
}
